home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / Includes_and_Autodocs_3.5 / include / workbench / icon.h next >
Encoding:
C/C++ Source or Header  |  1999-10-20  |  11.2 KB  |  338 lines

  1. #ifndef WORKBENCH_ICON_H
  2. #define WORKBENCH_ICON_H
  3. /*
  4. **    $VER: icon.h 44.39 (18.9.1999)
  5. **    Includes Release 44.1
  6. **
  7. **    External declarations for icon.library
  8. **
  9. **    Copyright © 1985-1999 Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef GRAPHICS_VIEW_H
  14. #include <graphics/view.h>
  15. #endif /* !GRAPHICS_VIEW_H */
  16.  
  17. #ifndef INTUITION_IMAGECLASS_H
  18. #include <intuition/imageclass.h>
  19. #endif /* !INTUITION_IMAGECLASS_H */
  20.  
  21. #ifndef UTILITY_TAGITEM_H
  22. #include <utility/tagitem.h>
  23. #endif /* !UTILITY_TAGITEM_H */
  24.  
  25. #ifndef DATATYPES_PICTURECLASS_H
  26. #include <datatypes/pictureclass.h>
  27. #endif /* !DATATYPES_PICTURECLASS_H */
  28.  
  29. #ifndef DOS_DOS_H
  30. #include <dos/dos.h>
  31. #endif /* !DOS_DOS_H */
  32.  
  33. /****************************************************************************/
  34.  
  35. #define ICONNAME "icon.library"
  36.  
  37. /****************************************************************************/
  38.  
  39. #define ICONA_Dummy (TAG_USER+0x9000)
  40.  
  41. /****************************************************************************/
  42.  
  43. /* Error reporting (LONG *) */
  44. #define ICONA_ErrorCode     (ICONA_Dummy+1)
  45.  
  46. /* Points to the tag item that caused the error (struct TagItem **). */
  47. #define ICONA_ErrorTagItem    (ICONA_Dummy+75)
  48.  
  49. /****************************************************************************/
  50.  
  51. /* Global options for IconControlA() */
  52.  
  53. /* Screen to use for remapping Workbench icons to (struct Screen *) */
  54. #define ICONCTRLA_SetGlobalScreen        (ICONA_Dummy+2)
  55. #define ICONCTRLA_GetGlobalScreen        (ICONA_Dummy+3)
  56.  
  57. /* Icon color remapping precision; defaults to PRECISION_ICON (LONG) */
  58. #define ICONCTRLA_SetGlobalPrecision        (ICONA_Dummy+4)
  59. #define ICONCTRLA_GetGlobalPrecision        (ICONA_Dummy+5)
  60.  
  61. /* Icon frame size dimensions (struct Rectangle *) */
  62. #define ICONCTRLA_SetGlobalEmbossRect        (ICONA_Dummy+6)
  63. #define ICONCTRLA_GetGlobalEmbossRect        (ICONA_Dummy+7)
  64.  
  65. /* Render image without frame (BOOL) */
  66. #define ICONCTRLA_SetGlobalFrameless        (ICONA_Dummy+8)
  67. #define ICONCTRLA_GetGlobalFrameless        (ICONA_Dummy+9)
  68.  
  69. /* Enable NewIcons support (BOOL) */
  70. #define ICONCTRLA_SetGlobalNewIconsSupport    (ICONA_Dummy+10)
  71. #define ICONCTRLA_GetGlobalNewIconsSupport    (ICONA_Dummy+11)
  72.  
  73. /* Enable color icon support (BOOL) */
  74. #define ICONCTRLA_SetGlobalColorIconSupport    (ICONA_Dummy+77)
  75. #define ICONCTRLA_GetGlobalColorIconSupport    (ICONA_Dummy+78)
  76.  
  77. /* Set/Get the hook to be called when identifying a file (struct Hook *) */
  78. #define ICONCTRLA_SetGlobalIdentifyHook        (ICONA_Dummy+12)
  79. #define ICONCTRLA_GetGlobalIdentifyHook        (ICONA_Dummy+13)
  80.  
  81. /* Set/get the maximum length of a file/drawer name supported
  82.  * by icon.library (LONG).
  83.  */
  84. #define ICONCTRLA_SetGlobalMaxNameLength    (ICONA_Dummy+67)
  85. #define ICONCTRLA_GetGlobalMaxNameLength    (ICONA_Dummy+68)
  86.  
  87. /****************************************************************************/
  88.  
  89. /* Per icon local options for IconControlA() */
  90.  
  91. /* Get the icon rendering masks (PLANEPTR) */
  92. #define ICONCTRLA_GetImageMask1        (ICONA_Dummy+14)
  93. #define ICONCTRLA_GetImageMask2        (ICONA_Dummy+15)
  94.  
  95. /* Transparent image color; set to -1 if opaque */
  96. #define ICONCTRLA_SetTransparentColor1    (ICONA_Dummy+16)
  97. #define ICONCTRLA_GetTransparentColor1    (ICONA_Dummy+17)
  98. #define ICONCTRLA_SetTransparentColor2    (ICONA_Dummy+18)
  99. #define ICONCTRLA_GetTransparentColor2    (ICONA_Dummy+19)
  100.  
  101. /* Image color palette (struct ColorRegister *) */
  102. #define ICONCTRLA_SetPalette1        (ICONA_Dummy+20)
  103. #define ICONCTRLA_GetPalette1        (ICONA_Dummy+21)
  104. #define ICONCTRLA_SetPalette2        (ICONA_Dummy+22)
  105. #define ICONCTRLA_GetPalette2        (ICONA_Dummy+23)
  106.  
  107. /* Size of image color palette (LONG) */
  108. #define ICONCTRLA_SetPaletteSize1    (ICONA_Dummy+24)
  109. #define ICONCTRLA_GetPaletteSize1    (ICONA_Dummy+25)
  110. #define ICONCTRLA_SetPaletteSize2    (ICONA_Dummy+26)
  111. #define ICONCTRLA_GetPaletteSize2    (ICONA_Dummy+27)
  112.  
  113. /* Image data; one by per pixel (UBYTE *) */
  114. #define ICONCTRLA_SetImageData1        (ICONA_Dummy+28)
  115. #define ICONCTRLA_GetImageData1        (ICONA_Dummy+29)
  116. #define ICONCTRLA_SetImageData2        (ICONA_Dummy+30)
  117. #define ICONCTRLA_GetImageData2        (ICONA_Dummy+31)
  118.  
  119. /* Render image without frame (BOOL) */
  120. #define ICONCTRLA_SetFrameless        (ICONA_Dummy+32)
  121. #define ICONCTRLA_GetFrameless        (ICONA_Dummy+33)
  122.  
  123. /* Enable NewIcons support (BOOL) */
  124. #define ICONCTRLA_SetNewIconsSupport    (ICONA_Dummy+34)
  125. #define ICONCTRLA_GetNewIconsSupport    (ICONA_Dummy+35)
  126.  
  127. /* Icon aspect ratio (UBYTE *) */
  128. #define ICONCTRLA_SetAspectRatio    (ICONA_Dummy+36)
  129. #define ICONCTRLA_GetAspectRatio    (ICONA_Dummy+37)
  130.  
  131. /* Icon dimensions; valid only for palette mapped icon images (LONG) */
  132. #define ICONCTRLA_SetWidth        (ICONA_Dummy+38)
  133. #define ICONCTRLA_GetWidth        (ICONA_Dummy+39)
  134. #define ICONCTRLA_SetHeight        (ICONA_Dummy+40)
  135. #define ICONCTRLA_GetHeight        (ICONA_Dummy+41)
  136.  
  137. /* Check whether the icon is palette mapped (LONG *). */
  138. #define ICONCTRLA_IsPaletteMapped    (ICONA_Dummy+42)
  139.  
  140. /* Get the screen the icon is attached to (struct Screen **). */
  141. #define ICONCTRLA_GetScreen        (ICONA_Dummy+43)
  142.  
  143. /* Check whether the icon has a real select image (LONG *). */
  144. #define ICONCTRLA_HasRealImage2        (ICONA_Dummy+44)
  145.  
  146. /* Check whether the icon is of the NewIcon type (LONG *). */
  147. #define ICONCTRLA_IsNewIcon        (ICONA_Dummy+79)
  148.  
  149. /* Check whether this icon was allocated by icon.library
  150.  * or if consists solely of a statically allocated
  151.  * struct DiskObject. (LONG *).
  152.  */
  153. #define ICONCTRLA_IsNativeIcon        (ICONA_Dummy+80)
  154.  
  155. /****************************************************************************/
  156.  
  157. /* Icon aspect ratio is not known. */
  158. #define ICON_ASPECT_RATIO_UNKNOWN (0)
  159.  
  160. /* Pack the aspect ratio into a single byte. */
  161. #define PACK_ICON_ASPECT_RATIO(num,den) (((num) << 4) | (den))
  162.  
  163. /* Unpack the aspect ratio stored in a single byte. */
  164. #define UNPACK_ICON_ASPECT_RATIO(v,num,den)    \
  165.     do                    \
  166.     {                    \
  167.         num    = (((v) >> 4) & 15);    \
  168.         den    = ( (v)       & 15);    \
  169.     }                    \
  170.     while(0)
  171.  
  172. /****************************************************************************/
  173.  
  174. /* Tags for use with GetIconTagList() */
  175.  
  176. /* Default icon type to retrieve (LONG) */
  177. #define ICONGETA_GetDefaultType        (ICONA_Dummy+45)
  178.  
  179. /* Retrieve default icon for the given name (STRPTR) */
  180. #define ICONGETA_GetDefaultName        (ICONA_Dummy+46)
  181.  
  182. /* Return a default icon if the requested icon
  183.  * file cannot be found (BOOL).
  184.  */
  185. #define ICONGETA_FailIfUnavailable    (ICONA_Dummy+47)
  186.  
  187. /* If possible, retrieve a palette mapped icon (BOOL). */
  188. #define ICONGETA_GetPaletteMappedIcon    (ICONA_Dummy+48)
  189.  
  190. /* Set if the icon returned is a default icon (BOOL *). */
  191. #define ICONGETA_IsDefaultIcon        (ICONA_Dummy+49)
  192.  
  193. /* Remap the icon to the default screen, if possible (BOOL). */
  194. #define ICONGETA_RemapIcon        (ICONA_Dummy+50)
  195.  
  196. /* Generate icon image masks (BOOL). */
  197. #define ICONGETA_GenerateImageMasks    (ICONA_Dummy+51)
  198.  
  199. /* Label text to be assigned to the icon (STRPTR). */
  200. #define ICONGETA_Label            (ICONA_Dummy+52)
  201.  
  202. /* Screen to remap the icon to (struct Screen *). */
  203. #define ICONGETA_Screen            (ICONA_Dummy+69)
  204.  
  205. /****************************************************************************/
  206.  
  207. /* Tags for use with PutIconTagList() */
  208.  
  209. /* Notify Workbench of the icon being written (BOOL) */
  210. #define ICONPUTA_NotifyWorkbench    (ICONA_Dummy+53)
  211.  
  212. /* Store icon as the default for this type (LONG) */
  213. #define ICONPUTA_PutDefaultType        (ICONA_Dummy+54)
  214.  
  215. /* Store icon as a default for the given name (STRPTR) */
  216. #define ICONPUTA_PutDefaultName        (ICONA_Dummy+55)
  217.  
  218. /* When storing a palette mapped icon, don't save the
  219.  * the original planar icon image with the file. Replace
  220.  * it with a tiny replacement image.
  221.  */
  222. #define ICONPUTA_DropPlanarIconImage    (ICONA_Dummy+56)
  223.  
  224. /* Don't write the chunky icon image data to disk. */
  225. #define ICONPUTA_DropChunkyIconImage    (ICONA_Dummy+57)
  226.  
  227. /* Don't write the NewIcons tool types to disk. */
  228. #define ICONPUTA_DropNewIconToolTypes    (ICONA_Dummy+58)
  229.  
  230. /* If this tag is enabled, the writer will examine the
  231.  * icon image data to find out whether it can compress
  232.  * it more efficiently. This may take extra time and
  233.  * is not generally recommended.
  234.  */
  235. #define ICONPUTA_OptimizeImageSpace    (ICONA_Dummy+59)
  236.  
  237. /* Don't write the entire icon file back to disk,
  238.  * only change the do->do_CurrentX/do->do_CurrentY
  239.  * members.
  240.  */
  241. #define ICONPUTA_OnlyUpdatePosition    (ICONA_Dummy+72)
  242.  
  243. /* Before writing a palette mapped icon back to disk,
  244.  * icon.library will make sure that the original
  245.  * planar image data is stored in the file. If you
  246.  * don't want that to happen, set this option to
  247.  * FALSE. This will allow you to change the planar icon
  248.  * image data written back to disk.
  249.  */
  250. #define ICONPUTA_PreserveOldIconImages    (ICONA_Dummy+84)
  251.  
  252. /****************************************************************************/
  253.  
  254. /* For use with the file identification hook. */
  255.  
  256. struct IconIdentifyMsg
  257. {
  258.     /* Libraries that are already opened for your use. */
  259.     struct Library *    iim_SysBase;
  260.     struct Library *    iim_DOSBase;
  261.     struct Library *    iim_UtilityBase;
  262.     struct Library *    iim_IconBase;
  263.  
  264.     /* File context information. */
  265.     BPTR            iim_FileLock;    /* Lock on the object to return an icon for. */
  266.     BPTR            iim_ParentLock;    /* Lock on the object's parent directory, if available. */
  267.     struct FileInfoBlock *    iim_FIB;    /* Already initialized for you. */
  268.     BPTR            iim_FileHandle;    /* If non-NULL, pointer to the file to examine,
  269.                          * positioned right at the first byte, ready
  270.                          * for you to use.
  271.                          */
  272.     struct TagItem *    iim_Tags;    /* Tags passed to GetIconTagList(). */
  273. };
  274.  
  275. /****************************************************************************/
  276.  
  277. /* Tags for use with DupDiskObjectA() */
  278.  
  279. /* Duplicate do_DrawerData */
  280. #define ICONDUPA_DuplicateDrawerData    (ICONA_Dummy+60)
  281.  
  282. /* Duplicate the Image structures. */
  283. #define ICONDUPA_DuplicateImages    (ICONA_Dummy+61)
  284.  
  285. /* Duplicate the image data (Image->ImageData) itself. */
  286. #define ICONDUPA_DuplicateImageData    (ICONA_Dummy+62)
  287.  
  288. /* Duplicate the default tool. */
  289. #define ICONDUPA_DuplicateDefaultTool    (ICONA_Dummy+63)
  290.  
  291. /* Duplicate the tool types list. */
  292. #define ICONDUPA_DuplicateToolTypes    (ICONA_Dummy+64)
  293.  
  294. /* Duplicate the tool window. */
  295. #define ICONDUPA_DuplicateToolWindow    (ICONA_Dummy+65)
  296.  
  297. /* If the icon to be duplicated is in fact a palette mapped
  298.  * icon which has never been set up to be displayed on the
  299.  * screen, turn the duplicate into that palette mapped icon.
  300.  */
  301. #define ICONDUPA_ActivateImageData    (ICONA_Dummy+82)
  302.  
  303. /****************************************************************************/
  304.  
  305. /* Tags for use with DrawIconStateA() and GetIconRectangleA(). */
  306.  
  307. /* Drawing information to use (struct DrawInfo *). */
  308. #define ICONDRAWA_DrawInfo        (ICONA_Dummy+66)
  309.  
  310. /* Draw the icon without the surrounding frame (BOOL). */
  311. #define ICONDRAWA_Frameless        (ICONA_Dummy+70)
  312.  
  313. /* Erase the background before drawing a frameless icon (BOOL). */
  314. #define ICONDRAWA_EraseBackground    (ICONA_Dummy+71)
  315.  
  316. /* Draw the icon without the surrounding border and frame (BOOL). */
  317. #define ICONDRAWA_Borderless        (ICONA_Dummy+83)
  318.  
  319. /****************************************************************************/
  320.  
  321. /* Reserved tags; don't use! */
  322. #define ICONA_Reserved1    (ICONA_Dummy+73)
  323. #define ICONA_Reserved2    (ICONA_Dummy+74)
  324. #define ICONA_Reserved3 (ICONA_Dummy+76)
  325. #define ICONA_Reserved4 (ICONA_Dummy+81)
  326. #define ICONA_Reserved5 (ICONA_Dummy+85)
  327. #define ICONA_Reserved6 (ICONA_Dummy+86)
  328. #define ICONA_Reserved7 (ICONA_Dummy+87)
  329. #define ICONA_Reserved8 (ICONA_Dummy+88)
  330.  
  331. /****************************************************************************/
  332.  
  333. #define ICONA_LAST_TAG (ICONA_Dummy+88)
  334.  
  335. /****************************************************************************/
  336.  
  337. #endif  /* !WORKBENCH_ICON_H */
  338.